package com.itfitness.myapplication

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.text.TextUtils
import android.view.ViewGroup
import android.widget.TextView
import com.blankj.utilcode.util.LogUtils
import com.blankj.utilcode.util.ToastUtils
import kotlin.concurrent.thread

class MainActivity : AppCompatActivity() {
    private var flag:Boolean = true
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val tv = findViewById<TextView>(R.id.tv_showMsg)

    }

    override fun onResume() {
        super.onResume()
    }
    override fun onDestroy() {
        super.onDestroy()
        flag = false
    }

    /**
     * 显示吐司
     */
    fun showToast(msg:String){
        LogUtils.eTag("打印",msg)
        if(!TextUtils.isEmpty(msg)){
            runOnUiThread {
                ToastUtils.showShort(msg)
            }
        }
    }
}